<%-- 
    Document   : price_main
    Created on : Nov 20, 2008, 9:57:20 PM
    Author     : Vyor
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="f" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
<h3>Prices</h3>
<table>
    <tr>
        <td class="menucon">
            <html:link action="/prc_presave.do" title="Create new price">New Price</html:link>
        </td>
        <td class="menucon">
            <html:link action="/prc_initdata.do" title="Find certain price">Find Price</html:link>
        </td>
    </tr>
</table>
<html:messages id="messages" property="customMessage" message="true">
    <div class="heading4"><bean:write name="messages"/></div>
</html:messages>
<html:errors/>
<html:messages id="messages" property="message" message="true">
    <ul>
        <li><bean:write name="messages"/></li>
    </ul>
</html:messages>
<table>
    <tr class="table_header">
        <th>No.</th>
        <th>Code</th>
        <th>Type</th>
        <th>Unit</th>
        <th>Price</th>
        <th>Action</th>
    </tr>
    <c:set var="x" value="0"/>
    <c:forEach items="${prices}" var="price">
        <tr>
            <td>${x+1}.</td>
            <td>${price.kode}</td>
            <td><html:link action="/prc_getpricesbyjenis.do?id=${price.jenis.id}">${price.jenis.nama}</html:link></td>
            <td><html:link action="/prc_getpricesbyunit.do?id=${price.unit.id}">${price.unit.nama}</html:link></td>
            <td class="currency"><f:formatNumber value="${price.harga}" maxFractionDigits="0" currencySymbol="Rp " type="currency"/></td>
            <td>
                <html:link action="/prc_delete.do?id=${price.id}">Delete</html:link>
                <html:link action="/prc_preupdate.do?id=${price.id}">Edit</html:link>
            </td>            
        </tr>
        <c:set var="x" value="${x+1}"/>
    </c:forEach>    
        <tr class="table_footer">
            <td colspan="10">PT. Dhemar Nusantara - PT. Rahmi Ida Nusantara</td>
        </tr>
</table>
